home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / semget.man < prev    next >
Encoding:
Text File  |  1990-11-15  |  4.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. SEMGET                C Library Procedures                 SEMGET
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      semget - get set of semaphores
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  13.      ##iinncclluuddee <<ssyyss//iippcc..hh>>
  14.      ##iinncclluuddee <<ssyyss//sseemm..hh>>
  15.  
  16.      iinntt sseemmggeett((kkeeyy,, nnsseemmss,, sseemmffllgg))
  17.      kkeeyy__tt kkeeyy;;
  18.      iinntt nnsseemmss,, sseemmffllgg;;
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.      sseemmggeett(()) returns the semaphore identifier associated with
  22.      _k_e_y.
  23.  
  24.      A semaphore identifier and associated data structure and set
  25.      containing _n_s_e_m_s semaphores (see iinnttrroo(2)) are created for
  26.      _k_e_y if one of the following are true:
  27.  
  28.      o+    _k_e_y is equal to IIPPCC__PPRRIIVVAATTEE.
  29.  
  30.      o+    _k_e_y does not already have a semaphore identifier asso-
  31.           ciated with it, and (_s_e_m_f_l_g & IIPPCC__CCRREEAATT) is ``true''.
  32.  
  33.      Upon creation, the data structure associated with the new
  34.      semaphore identifier is initialized as follows:
  35.  
  36.      o+    sseemm__ppeerrmm..ccuuiidd, sseemm__ppeerrmm..uuiidd, sseemm__ppeerrmm..ccggiidd, and
  37.           sseemm__ppeerrmm..ggiidd are set equal to the effective user ID and
  38.           effective group ID, respectively, of the calling pro-
  39.           cess.
  40.  
  41.      o+    The low-order 9 bits of sseemm__ppeerrmm..mmooddee are set equal to
  42.           the low-order 9 bits of _s_e_m_f_l_g.
  43.  
  44.      o+    sseemm__nnsseemmss is set equal to the value of _n_s_e_m_s.
  45.  
  46.      o+    sseemm__oottiimmee is set equal to 0 and sseemm__ccttiimmee is set equal
  47.           to the current time.
  48.  
  49. RREETTUURRNN VVAALLUUEE
  50.      Upon successful completion, a non-negative integer, namely a
  51.      semaphore identifier, is returned.  Otherwise, a value of -1
  52.      is returned and eerrrrnnoo is set to indicate the error.
  53.  
  54. EERRRROORRSS
  55.      sseemmggeett(()) will fail if one or more of the following are true:
  56.  
  57.      EINVAL              _n_s_e_m_s is either less than or equal to
  58.                          zero or greater than the system-imposed
  59.                          limit.
  60.  
  61.  
  62.  
  63. Sprite v1.0             21 November 1987                        1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SEMGET                C Library Procedures                 SEMGET
  71.  
  72.  
  73.  
  74.      EACCES              A semaphore identifier exists for _k_e_y,
  75.                          but operation permission (see iinnttrroo(2))
  76.                          as specified by the low-order 9 bits of
  77.                          _s_e_m_f_l_g would not be granted.
  78.  
  79.      EINVAL              A semaphore identifier exists for _k_e_y,
  80.                          but the number of semaphores in the set
  81.                          associated with it is less than _n_s_e_m_s
  82.                          and _n_s_e_m_s is not equal to zero.
  83.  
  84.      ENOENT              A semaphore identifier does not exist
  85.                          for _k_e_y and (_s_e_m_f_l_g & IIPPCC__CCRREEAATT) is
  86.                          ``false''.
  87.  
  88.      ENOSPC              A semaphore identifier is to be created
  89.                          but the system-imposed limit on the max-
  90.                          imum number of allowed semaphore iden-
  91.                          tifiers system wide would be exceeded.
  92.  
  93.      ENOSPC              A semaphore identifier is to be created
  94.                          but the system-imposed limit on the max-
  95.                          imum number of allowed semaphores system
  96.                          wide would be exceeded.
  97.  
  98.      EEXIST              A semaphore identifier exists for _k_e_y
  99.                          but ( (_s_e_m_f_l_g & IIPPCC__CCRREEAATT) and (_s_e_m_f_l_g &
  100.                          IIPPCC__EEXXCCLL))) is ``true''.
  101.  
  102. SSEEEE AALLSSOO
  103.      iinnttrroo(2), sseemmccttll(2), sseemmoopp(2)
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0             21 November 1987                        2
  130.  
  131.  
  132.  
  133.